package larpplanner.database;

@DBTable("player")
public class Player implements DBObject {

	public static final String ID_COL      = "player_id";
	public static final String NAME_COL    = "player_name";
	public static final String PHONE_COL   = "phone";
	public static final String EMAIL_COL   = "email";
	public static final String PASS_COL    = "password";
	
    @DBCol(ID_COL)
	protected long id;
    
    @DBCol(NAME_COL)
    protected String name;
	
    @DBCol(PHONE_COL)
    protected String phone;
    
    @DBCol(EMAIL_COL)
    protected String email;
    
    @DBCol(PASS_COL)
    protected String pass;
	
	public Player() {}

	public Player(String player_name, String phone, String email,String pass) {
		this.name = player_name;
		this.phone = phone;
		this.email = email;
		this.pass = pass;
	}

	public void setId(long id) {
		this.id = id;
	}

	public long getId() {
		return id;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getName() {
		return name;
	}

	public void setPhone(String phone) {
		this.phone = phone;
	}

	public String getPhone() {
		return phone;
	}

	public void setEmail(String email) {
		this.email = email;
	}

	public String getEmail() {
		return email;
	}

    public String toString() {
        return email;
    }
	
	public String getPass() {
		return pass;
	}

	public void setPass(String pass) {
		this.pass = pass;
	}
	
	public String getFullRepresentitiveString() {
		return "" + (id == 0 ? "?" : id) + " " + name + " " + phone + " " + email;
	}
	
}
